#!/bin/bash


while read file
do
    case "$1" in
		"w")
			~/.scripts/changepape -b "$file" ;;
		"r")
			convert -rotate 90 "$file" "$file" ;;
		"R")
			convert -rotate -90 "$file" "$file" ;;
		"f")
			convert -flop "$file" "$file" ;;
		"y")
			echo -n "$file" | xclip -selection clipboard &&
				notify-send "$file copied to clipboard" & ;;
		"Y")
			echo -n "$(readlink -f "$file")" | xclip -selection clipboard &&
				notify-send "$(readlink -f "$file") copied to clipboard" & ;;
		"d")
		    [ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;

                "C-d")
		    dragon -a -x $file ;;
    esac
done
